<?php use_helper('I18N') ?>
<?php use_helper('jQuery')?>

<script type="text/javascript">
    $(function() {
        $("input:submit").button();
    });
</script>

<div class="voting-form-container span-17 last">
    <?php echo jq_form_remote_tag(
        array(
            'update' => 'main-content',
            'url' => url_for('votaciones_save'),
            'before' => 'showLoader();',
            'complete' => 'hideLoader();',
            'script' => true
        ), array(
            'id' => 'voting-form',
            'class' => ''
        )); ?>
        <?php $isnew = true; ?>
        <?php foreach ($form['votes'] as $key => $voteForm) :?>
            <?php echo $form['votes'][$key]->render() ?>
        <?php endforeach; ?>
        <?php echo $form->renderHiddenFields(false); ?>
        <?php if(!$isnew): ?>
            <input type="hidden" name="sf_method" value="put" />
        <?php endif;?>
        <div class="voting-form-submit span-17 last">
            <input type="submit" value="<?php echo __("Votar") ?>" />
        </div>
    </form>
</div>
